From 1d09d5d86efb84fa1b5d36a9d346cd715d21e276 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 11 Dec 2006 21:46:31 +0000 Subject: [PATCH] Add Trendware TEW-411BRplus (#1038) SVN-Revision: 5764 --- openwrt/target/linux/package/diag/src/diag.c | 18 ++++++++++++++++++ .../linux/package/switch/src/switch-adm.c | 11 ++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/openwrt/target/linux/package/diag/src/diag.c b/openwrt/target/linux/package/diag/src/diag.c index 0b445f8c22..0537da1d09 100644 --- a/openwrt/target/linux/package/diag/src/diag.c +++ b/openwrt/target/linux/package/diag/src/diag.c @@ -85,6 +85,9 @@ enum { /* Belkin */ BELKIN_UNKNOWN, + + /* Trendware */ + TEW411BRPP, }; static struct platform_t __init platforms[] = { @@ -410,6 +413,17 @@ static struct platform_t __init platforms[] = { { .name = "connected", .gpio = 1 << 0, .polarity = NORMAL }, }, }, + [TEW411BRPP] = { + .name = "Trendware TEW411BRP+", + .buttons = { + { /* No usable buttons */ }, + }, + .leds = { + { .name = "power", .gpio = 1 << 7, .polarity = NORMAL }, + { .name = "wlan", .gpio = 1 << 1, .polarity = NORMAL }, + { .name = "bridge", .gpio = 1 << 6, .polarity = NORMAL }, + }, + }, }; static inline char __init *getvar(char *str) @@ -508,6 +522,10 @@ static struct platform_t __init *platform_detect(void) return &platforms[WR850GV2V3]; } + if (!strcmp(boardnum, "44")) { /* trendware TEW-411BRP+ */ + return &platforms[TEW411BRPP]; + } + /* not found */ return NULL; } diff --git a/openwrt/target/linux/package/switch/src/switch-adm.c b/openwrt/target/linux/package/switch/src/switch-adm.c index 113138a8fd..423c5a88d3 100644 --- a/openwrt/target/linux/package/switch/src/switch-adm.c +++ b/openwrt/target/linux/package/switch/src/switch-adm.c @@ -493,8 +493,17 @@ static int detect_adm() #if defined(BCMGPIO2) || defined(BCMGPIO) int boardflags = atoi(nvram_get("boardflags")); + int boardnum = atoi(nvram_get("boardnum")); - if ((boardflags & 0x80) || force) { + if (boardnum == 44) { /* trendware TEW-411BRP+ */ + ret = 1; + + eecs = getgpiopin("adm_eecs", 2); + eesk = getgpiopin("adm_eesk", 3); + eedi = getgpiopin("adm_eedi", 4); + eerc = getgpiopin("adm_rc", 5); + + } else if ((boardflags & 0x80) || force) { ret = 1; eecs = getgpiopin("adm_eecs", 2); -- 2.30.2